<template>
  <page-header-wrapper :title="false">
    <a-card title="学习记录">
      <s-table
        bordered
        ref="table"
        :row-key="(record) => record.id"
        :columns="recordColumns"
        :data="recordData"
      >
        <template slot="index" slot-scope="text,record,index">
          {{ index + 1 }}
        </template>
        <template slot="video_time" slot-scope="text">
          <a-tag color="red">{{ text }}</a-tag>
        </template>
        <template slot="logs" slot-scope="text">
          <a-progress :percent="text/2 * 100" />
        </template>
      </s-table>
    </a-card>
  </page-header-wrapper>
</template>

<script>
  import { STable } from '@/components'
  import col from '@/columns/video'
  import { getVideoList } from '@/api/video'
  export default {
    components: {
      STable
    },
    name: 'VideoRecord',
    data () {
      return {
        recordColumns: col.recording,
        recordData: parameters => {
          return getVideoList(Object.assign(parameters, this.queryParam)).then(res => {
            return res.result
          })
        },
        queryParam: {}
      }
    },
    methods: {
    }
  }
</script>

<style scoped>

</style>
